/*
 *      css_location.cpp
 *      
 *      Copyright 2009 Aaron Lehrian <jsmaster@tampabay.rr.com>
 *      
 *      This program is free software; you can redistribute it and/or modify
 *      it under the terms of the GNU General Public License as published by
 *      the Free Software Foundation; either version 2 of the License, or
 *      (at your option) any later version.
 *      
 *      This program is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *      GNU General Public License for more details.
 *      
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */


#include "css_location.h"

#include <string.h>

css_location::css_location()
{
	name = new css_name;
	name->id = NULL;
	name->clss = NULL;
	name->tag = NULL;
}


css_location::~css_location()
{
	
}

void css_location::setvalue(int t, char *n){
	if((t & ID)){
		name->id = new char [strlen(n)+1];
		strncpy(name->id,n,strlen(n)+1);
	}
	if((t & CLASS)){
		name->clss = new char [strlen(n)+1];
		strncpy(name->clss,n,strlen(n)+1);
	}
	if((t & TAG)){
		name->tag = new char [strlen(n)+1];
		strncpy(name->tag,n,strlen(n)+1);
	}
}

css_name *css_location::getvalue(){
	return name;
}

int css_location::gettype(){
	return type;
}

void css_location::settype(int t){
	type |= t;
}
